<div class="container-fluid">
    <app-page-title name="Questionnaire" [breadcrumbItems]="breadCrumbItems"></app-page-title>

    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-body">
                    <h4 class="mb-5">Create Questionnaire</h4>
                    <form class="needs-validation" (ngSubmit)="validSubmit()" [formGroup]="questionForm">
                        <div class="form-group">
                            <label for="question">Question</label>
                            <input type="text" class="form-control" id="question" formControlName="question"
                                placeholder="Question" onfocus="this.placeholder =''"
                                onblur="this.placeholder = 'Add a question here!'"
                                [ngClass]="{'is-invalid': submit && form.question.errors}">
                            <div *ngIf="submit && form.question.errors" class="invalid-feedback">
                                <span *ngIf="form.question.errors.required">Required!</span>
                            </div>
                        </div>
                        <div class="text-right">
                            <button (click)="createQuestion()" class="btn btn-success mr-2"
                                type="button">Create</button>
                            <button [routerLink]="['/checklists/manage', checklist_id]" class="btn btn-danger"
                                type="button">Cancel</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>